package com.xunwulian.cmpp.server;


import com.xunwulian.cmpp.server.handler.MinaCmpp;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication(scanBasePackages="com.xunwulian")
@MapperScan("com.xunwulian.base.dao")
public class CmppServerApplication implements CommandLineRunner {

    @Autowired
    private MinaCmpp server;

    public static void main(String[] args) {
        SpringApplication.run(CmppServerApplication.class, args);
        try {
            Thread.sleep(3600 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void run(String... strings) throws Exception {
        server.run();
    }
}